//
//  MyRelatedCell.swift
//  QualityControlSystem
//
//  Created by dundun on 17/1/17.
//  Copyright © 2017年 com.mask. All rights reserved.
//

import UIKit
import SnapKit

class MyRelatedCell: UITableViewCell {

    @IBOutlet weak var title: UILabel!
    
    var switchValueChanged: (() -> ())?
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        selectionStyle = .none
        title.textColor = Color.textMedium
    }
    
//    func setupRightBtn() {
//        let rightImageView = UIImageView(image: UIImage(named: ""))
//        rightImageView.backgroundColor = UIColor.blue
//        contentView.addSubview(rightImageView)
//        rightImageView.snp.makeConstraints { (make) in
//            make.right.equalTo(self).offset(-Padding.left)
//            make.width.height.equalTo(25.0)
//            make.centerY.equalTo(self)
//        }
//    }
    
    func setupSlider() {
        let switchBtn = UISwitch()
        switchBtn.addTarget(self, action: #selector(switchBtnValueChanged(switchBtn:)), for: UIControlEvents.valueChanged)
        switchBtn.isOn = false
        contentView.addSubview(switchBtn)
        switchBtn.snp.makeConstraints { (make) in
            make.right.equalTo(self).offset(-Padding.left)
            make.centerY.equalTo(self)
        }
    }
    
    func switchBtnValueChanged(switchBtn: UISwitch) {
        switchValueChanged?()
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
